/*
 * @ author Junr
 * @ use 商品
 */
import Request from '../request';
export default {
  // 商品列表
  goods (params) {
    return Request.post({ url: `/g/list`, params });
  },
  // 商品分类列表
  type (params) {
    return Request.post({ url: `/g/cats/list/one`, params });
  },
  // 商品分类列表
  catelist (params) {
    return Request.post({ url: `/g/cats/list`, params });
  },
  // 商品列表
  goodslist (params) {
    return Request.post({ url: `/g/list`, params });
  },
  // 运费
  goodsfreight (params) {
    return Request.post({ url: `/g/freight/goods`, params });
  },
  // 商品详情信息
  goodsInfo (params) {
    return Request.post({ url: `/g/detail`, params });
  },
  // 商品规格
  goodsSpec (params) {
    return Request.post({ url: `/g/detail/spec`, params });
  },
  // 获取商品优惠劵
  goodsCoupon (params) {
    return Request.post({ url: `/g/detail/coupon`, params });
  },
  // 商品属性
  goodsAttr (params) {
    return Request.post({ url: `/g/detail/attr`, params });
  },
  // 商品收藏
  goodsFavorite (params, type) {
    return Request.post({ url: `/m/favorite/goods/${type}`, params });
  },
  // 商品评价
  goodsAppraise (params, type) {
    var url = type ? `g/detail/appraise/${type}` : 'g/detail/appraise';
    return Request.post({ url: url, params });
  }

  // // 商品分享
  // goodsFavorite (params) {
  //   return Request.post({ url: `/m/favorite/goods/add`, params });
  // }
};
